package com.dongwei.looker;

import java.util.ArrayList;
import java.util.List;

/**
 * 目标对象，他知道观察他的对象 ，并提供注册
 */
public class Zhuce {

    private List<Guancha> list=new ArrayList<>();

    public void attend(Guancha guancha){
        list.add(guancha);
    }
    public void delect(Guancha guancha){
        list.remove(guancha);
    }

    /**
*CreatBy Chendongwei com.dongwei
*@Date ${time} ${date}
*@Auther 注册观察者
*/


    protected void notifyObservice(){
        for (Guancha guanchaIntF :list
             ) {
            guanchaIntF.update(this);
        }
    }
}
